package gold.digger;

import gold.utils.InputUtil;

import java.util.Arrays;

/**
 * Created by fanzhenyu02 on 2021/12/10.
 * common problem solver template.
 */
public class LC1051 {
    public long startExecuteTime = System.currentTimeMillis();


    class Solution {
        public int heightChecker(int[] heights) {
            int n = heights.length, ans = 0;
            int[] expected = new int[n];
            System.arraycopy(heights, 0, expected, 0, n);
            Arrays.sort(expected);
            for (int i = 0; i < n; ++i) {
                if (heights[i] != expected[i]) {
                    ++ans;
                }
            }
            return ans;
        }
    }


    public void run() {
        int[] arr = InputUtil.toIntegerArray("[1,2,3]");
        System.out.println(new Solution().toString());
    }

    public static void main(String[] args) throws Exception {
        LC1051 an = new LC1051();
        an.run();

        System.out.println("\ncurrent solution total execute time: " + (System.currentTimeMillis() - an.startExecuteTime) + " ms.");
    }
}
